package yesjava;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

public class Test4 {

    // 泛型 定义
//    题目的意义是 说明泛型方法的作用 :代码的错误从运行时提高到编译时
    public static <T> boolean listTest(List<T> list, T s){
        boolean rs = false;
        rs = list.contains(s);
        return  rs;
    }

    public static void main(String[] args) {
        List<String> stringList = Arrays.asList(new String[]{"中国", "美国", "加拿大", "英国", "越南", "缅甸"});
        System.out.println(listTest(stringList, "泰国"));


      /*  List<Integer> integerList = Arrays.asList(new Integer[]{855,58,74,868,5,7});
        System.out.println(listTest(integerList, 88));*/

    }


}
